﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:SharpAvi.Sample">

    <BooleanToVisibilityConverter x:Key="VcBool2Vis"/>
    <local:BooleanToObjectConverter x:Key="VcBool2VisInv" FalseValue="Visible" TrueValue="Collapsed"/>
    <local:BooleanToObjectConverter x:Key="VcBoolInv" FalseValue="True" TrueValue="False"/>
    
    <Style TargetType="TextBox">
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="BorderBrush" Value="DarkGray"/>
        <Setter Property="Foreground" Value="DarkGray"/>
    </Style>
    
    <Style TargetType="Label">
        <Setter Property="Foreground" Value="DarkGray"/>
    </Style>
    
    <Style TargetType="Button">
        <Setter Property="MinWidth" Value="80"/>
        <Setter Property="Padding" Value="4,2"/>
        <Setter Property="BorderBrush" Value="DarkGray"/>
        <Setter Property="BorderThickness" Value="3"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="DarkGray"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <ControlTemplate.Resources>
                        <DropShadowEffect x:Key="ButtonOverEffect" ShadowDepth="2" Color="LightGray" Opacity="0.75" Direction="285" BlurRadius="4" />
                        <local:BooleanToObjectConverter x:Key="VcButtonOverEffect" TrueValue="{StaticResource ButtonOverEffect}"/>
                    </ControlTemplate.Resources>

                    <Grid>
                        <Rectangle Effect="{TemplateBinding IsMouseOver, Converter={StaticResource VcButtonOverEffect}}"
                                   Fill="{TemplateBinding BorderBrush}"
                                   SnapsToDevicePixels="True"/>
                        <Border BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                SnapsToDevicePixels="True">
                            <ContentPresenter Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="Foreground" Value="DarkGray"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="Background" Value="DarkGray"/>
                <Setter Property="Foreground" Value="White"/>
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="True">
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="Background" Value="DarkGray"/>
                <Setter Property="Foreground" Value="White"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="BorderBrush" Value="LightGray"/>
                <Setter Property="Foreground" Value="LightGray"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="RoundButton" TargetType="{x:Type ButtonBase}">
        <Setter Property="Width" Value="36"/>
        <Setter Property="Height" Value="36"/>
        <Setter Property="BorderBrush" Value="DarkGray"/>
        <Setter Property="BorderThickness" Value="3"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="DarkGray"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <ControlTemplate.Resources>
                        <DropShadowEffect x:Key="ButtonOverEffect" ShadowDepth="2" Color="LightGray" Opacity="0.75" Direction="285" BlurRadius="4" />
                        <local:BooleanToObjectConverter x:Key="VcButtonOverEffect" TrueValue="{StaticResource ButtonOverEffect}"/>
                    </ControlTemplate.Resources>

                    <Grid>
                        <Ellipse Stroke="{TemplateBinding BorderBrush}"
                                 StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
                                 Fill="{TemplateBinding Background}"
                                 Effect="{TemplateBinding IsMouseOver, Converter={StaticResource VcButtonOverEffect}}"/>
                        <ContentPresenter Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="Foreground" Value="DarkGray"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="Background" Value="DarkGray"/>
                <Setter Property="Foreground" Value="White"/>
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="True">
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="Background" Value="DarkGray"/>
                <Setter Property="Foreground" Value="White"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="BorderBrush" Value="LightGray"/>
                <Setter Property="Foreground" Value="LightGray"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="RoundButtonGlyph" TargetType="{x:Type Shape}">
        <Setter Property="Fill" Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ButtonBase}}"/>
        <Setter Property="StrokeThickness" Value="0"/>
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="{Binding Width, RelativeSource={RelativeSource AncestorType=ButtonBase}}"
                                ScaleY="{Binding Height, RelativeSource={RelativeSource AncestorType=ButtonBase}}"/>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="{x:Type Expander}">
        <Setter Property="BorderBrush" Value="LightGray"/>
        <Setter Property="Padding" Value="7"/>
    </Style>
</ResourceDictionary>